class A
    def f
        return 1
    end
end

class B
    def f
        return 1.0
    end
end

def poly(a)
    b = a.f()
    return b
end

a = A.new
b = B.new

x = 1.0
x = poly(a.f())

y = 1
y = poly(b.f())
